package com.kehutong.crm.app;

import com.kehutong.common.util.Token;
import com.kehutong.crm.entity.TrackStatus;
import org.coraframework.inject.Inject;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;
import org.coraframework.mvc.http.result.Result;
import org.coraframework.orm.jdbc.JdbcSession;

import java.util.List;

/**
 * 跟进状态
 *
 * @author: liukunlong
 * @date: 2021-03-06 14:18
 */
@MvcAction
@ReqMapping("/kht-bin/trackStatus")
public class TrackStatusAction {

    @Inject
    private JdbcSession jdbcSession;

    /**
     * 获取跟进状态列表
     *
     * @param token 用户信息
     * @return 状态列表
     */
    @ReqMapping("/listStatus")
    public Object listStatus(Token token) {
        final List<TrackStatus> trackStatusList = jdbcSession.findArray(TrackStatus.class)
                .eq("deleted", false)
                .order("sort", "ASC")
                .exe();
        return Result.success(trackStatusList);
    }
}
